package com.atguigu.locks.controller;

import com.atguigu.locks.service.RedisIncrementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : leimingchao
 * @date Date : 2021年11月27日 18:54
 */
@RestController
public class HelloController {

    @Autowired
    private RedisIncrementService redisIncrementService;

    @GetMapping(value = "/increment")
    public String increment() {
        redisIncrementService.increment();
        return "ok";
    }

    @GetMapping(value = "/increment2")
    public String increment2() {
        redisIncrementService.incrementDistributeLock();
        return "ok";
    }

    @GetMapping(value = "/increment3")
    public String increment3() {
        redisIncrementService.useRedissonForLock();
        return "ok";
    }
}
